/**
 * Copyright &copy; 2012-2016 <a href="https://istep.lczyfz.com">Istep</a> All rights reserved.
 */
package com.lczyfz.istep.modules.race.service;

import java.util.List;

import com.lczyfz.istep.modules.race.entity.CtfSetSubject;
import com.lczyfz.istep.modules.race.entity.RaceSubject;
import com.lczyfz.istep.modules.resource.entity.ResourceCtfSet;
import com.lczyfz.istep.modules.resource.entity.ResourceCtfSubject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lczyfz.istep.common.persistence.Page;
import com.lczyfz.istep.common.service.CrudService;
import com.lczyfz.istep.modules.race.entity.RaceRepertory;
import com.lczyfz.istep.modules.race.dao.RaceRepertoryDao;

/**
 * 竞赛题库管理Service
 * @author CY
 * @version 2017-04-24
 */
@Service
@Transactional(readOnly = false)
public class RaceRepertoryService extends CrudService<RaceRepertoryDao, RaceRepertory> {

	@Autowired
	 RaceRepertoryDao raceRepertoryDao;

	public RaceRepertory get(String id) {
		return super.get(id);
	}
	
	public List<RaceRepertory> findList(RaceRepertory raceRepertory) {
		return super.findList(raceRepertory);
	}
	
	public Page<RaceRepertory> findPage(Page<RaceRepertory> page, RaceRepertory raceRepertory) {
		return super.findPage(page, raceRepertory);
	}
	
	@Transactional(readOnly = false)
	public void save(RaceRepertory raceRepertory) {
		super.save(raceRepertory);
	}
	
	@Transactional(readOnly = false)
	public void delete(RaceRepertory raceRepertory) {
		super.delete(raceRepertory);
	}

	public List<ResourceCtfSet> resourceCtfSets(){
      return  raceRepertoryDao.resourceCtfSets();
	}

   public  List<CtfSetSubject>  findListCtfSetSubject(String ctfSetId){
        return  raceRepertoryDao.findListCtfSetSubject(ctfSetId);
   }

	public  ResourceCtfSubject findCtfSubject(String id){
		return  raceRepertoryDao.findCtfSubject(id);
	}


	public  List<ResourceCtfSubject> findAddCtfSubject(){
		return  raceRepertoryDao.findAddCtfSubject();
	}

	public  void  insertRaceSubject(RaceSubject raceSubject){
		raceRepertoryDao.insertRaceSubject(raceSubject);
	}

	public void  deleteCtf(String repertoryId){
		raceRepertoryDao.deleteCtf(repertoryId);
	}

	public List<RaceSubject> findRaceSubject(){
		return  raceRepertoryDao.findRaceSubject();
	}

	public   RaceRepertory findRepertoryName(String repertoryName){
		return  raceRepertoryDao.findRepertoryName(repertoryName);
	}

}